import { http } from '@/utils/http'
import type { GoodsCategory } from './category.d'

// 获取前10条分类（带可选数量参数）
export const listLimit10 = (params?: { size?: number }) => {
  return http<GoodsCategory[]>({
    url: '/category/listLimit10',
    method: 'GET',
    query: params,
  })
}

// 根据父ID获取分类
export const selectByParentId = (parentId?: number) => {
  return http<GoodsCategory[]>({
    url: '/category/byParentId',
    method: 'GET',
    query: { parentId },
  })
}
